GtkApplication: use resources for loading menus
authorRyan Lortie <desrt@desrt.ca>
Fri, 4 Jul 2014 13:44:12 +0000 (09:44 -0400)
committerRyan Lortie <desrt@desrt.ca>
Mon, 7 Jul 2014 18:46:27 +0000 (14:46 -0400)
commit868ee07f492d60e87bcf4b4aa67b27de9e5ad4ea
treed640035c3e3e4b2aab202036635aa34bcdba49e4
parent59f3211b618bb55b3f0cb5cf4e22ad084248551d
GtkApplication: use resources for loading menus

Use the new ::resource-base-path property on #GApplication to attempt to
load the menu layout of the application.

We look first at gtk/menus-appmenu.ui or gtk/menus-traditional.ui
depending on the setting of gtk_application_prefers_app_menu().  Failing
that, we fall back to the common case of gtk/menus.ui (which should
always be given).  This provides a convenient way for application
authors to provide a different set of menus, depending on the desktop
environment they find themselves in.

As is the intention with other resources, if the resource base path is
unset, nothing will be loaded.  Additionally, if the expected files are not
found, it is not an error -- just nothing happens.

https://bugzilla.gnome.org/show_bug.cgi?id=722092
gtk/gtkapplication.c
gtk/gtkapplication.h